#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file:import3.py
@time:2016/10/31 0031 18:33
"""
class LazyImport:
    def __init__(self,module_name):
        self.module_name = module_name
        self.module = None
    def __getattr__(self, name):
        if self.module is None:
            self.module = __import__(self.module_name)
        print self.module
        print name
        print getattr(self.module,name) + 'aaaa'
        return getattr(self.module,name)

string = LazyImport("string")
print string.lowercase